﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SAS.Toolkit;

public partial class resultifo : basePage
{
    /// <summary>
    /// 成果列表
    /// </summary>
    TeamWorkInfos[] teamWorkList = null;
    /// <summary>
    /// 成果id(url参数)
    /// </summary>
    protected int actid = 0;
    /// <summary>
    /// 成果实体
    /// </summary>
    protected TeamWorkInfos teamWorkInfo = new TeamWorkInfos();
    /// <summary>
    /// 参与者人员列表
    /// </summary>
    protected string[] memList = null;

    protected void Page_Load(object sender, EventArgs e)
    {
        actid = Convert.ToInt32(Request.QueryString["actid"]);
        if (GetCacheWorkInfo(actid) != null)
        {
            teamWorkInfo = GetCacheWorkInfo(actid);
        }
        memList = teamWorkInfo.Members.Split(',');
    }
    /// <summary>
    /// 根据成果id获取缓存里的成果实体
    /// </summary>
    /// <param name="userName"></param>
    /// <returns></returns>
    protected TeamWorkInfos GetCacheWorkInfo(int actid)
    {
        teamWorkList = GetCacheTeamWorkInfos(1);
        List<TeamWorkInfos> mlist = new List<TeamWorkInfos>();
        mlist.AddRange(teamWorkList);
        //委托
        Predicate<TeamWorkInfos> mpush = new Predicate<TeamWorkInfos>(delegate(TeamWorkInfos work) { return work.Actid == actid; });
        teamWorkInfo = mlist.Find(mpush);
        return teamWorkInfo;
    }
}
